package com.kupurui.asteacher.adapter;

import android.content.Context;
import android.view.View;
import android.widget.FrameLayout;

import com.android.frame.adapter.CommonAdapter;
import com.android.frame.adapter.ViewHolder;
import com.github.lzyzsd.circleprogress.CircleProgress;
import com.kupurui.asteacher.R;
import com.kupurui.asteacher.bean.JobOverviewBean;
import com.kupurui.asteacher.http.Teacher;
import com.kupurui.asteacher.ui.BaseAty;
import com.kupurui.asteacher.view.NumberCircleProgressBar;

import java.util.List;

/**
 * Created by Administrator on 2017/7/24.
 */

public class JobOverviewAdapter extends CommonAdapter<JobOverviewBean.AnswerBean> {

    BaseAty activity;

    public JobOverviewAdapter(Context context, List<JobOverviewBean.AnswerBean> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
        activity = (BaseAty) context;
    }

    @Override
    public void convert(ViewHolder holder, JobOverviewBean.AnswerBean item, int positon) {
        FrameLayout frameUncorrecting = holder.getView(R.id.frame_uncorrecting);
        CircleProgress circleProgress = holder.getView(R.id.circle_progress);

        if (item.getPigai().equals("1")){
            frameUncorrecting.setVisibility(View.VISIBLE);
            circleProgress.setVisibility(View.GONE);
        }else{
            frameUncorrecting.setVisibility(View.GONE);
            circleProgress.setVisibility(View.VISIBLE);
            circleProgress.setProgress(item.getPercent());
        }

        holder.setTextViewText(R.id.tv_num,(positon+1)+"");



    }

}
